package com.corewillsoft.fireflies.gameobjects.fireflyraces;

public enum RaceType {
	
	BLACK(20f, new Color(0, 1f, 0)),
	WHITE(30f, new Color(0, 0, 1f));

	private float fireflySize;
	private Color portalColor;

	RaceType(float size, Color portalColor) {
		this.fireflySize = size;
		this.portalColor = portalColor;
	}

	// returns color of dead firefly
	public Color getDeadColor() {
		return new Color(0, 0, 0);
	}

	// returns color of firefly in the portal
	public Color getSavedColor() {
		return new Color(1, 1, 1);
	}

	// get size of the firefly
	public float getFireflySize() {
		return fireflySize;
	}

	public Color getColor(float energy) {
        if (this.equals(BLACK)) {
		    return new Color(1.0f - energy, energy, 0);
        } else if(this.equals(WHITE)) {
            return new Color(1.0f - energy, 0, energy);
        }

        return new Color(0, 0, 0);
	}

	public Color getPortalColor() {
		return portalColor;
	}
}